Linux fundamentals-LFS

Linux File System:

linux-filesystem.png

  1. / : is the Base Directory or Called Root Directory Not root user
  2. /root: home directory for the supreme Root user.
  3. /etc: contains Linux config Files and other sensitive information
  4. /mnt: other file systems are mounted.
  5. /media: where usb and CD's are attached or mounted.
  6. /bin:where Binaries/apps files located.
  7. /lib: where shared programs resides.

Linux base directory: The Root Directory

to access base Directory we type cd /

Sun-July-linux-17-35.png

login to and control the terminals of remote machines. Not only this, but the room will also have you:

  • Unlocking the potential of your first few commands by introducing you to using flags and arguments

  • Advancing your knowledge of the filesystem to perform some more useful commands such as copying and moving files

  • Discovering how access to files and folders is managed and how we can determine our access.

Root Directories:

/tmp: files are stored temporarily and will be removed after rebooting the system.

  • Great place to Store random notes or Enumeration Scripts

Sun-July-linux-18-42.png

/etc: Contains system files ex: etc/passwd or shadow file

  • Note Linux uses sha512 to hash a passwords etc/shadow
    Sun-July-linux-18-28.png

/etc/shadow overview

┌──(kali㉿kali)-[~/Desktop/Linux]
└─$ sudo cat  /etc/shadow | grep root
root:*:20201:0:99999:7:::
                                                                                                               
┌──(kali㉿kali)-[~/Desktop/Linux]
└─$ 

Explanation of Each Field

  • username: The name of the user account. In your example, it is root, which is the superuser account in Linux.
  • password: This field typically contains the hashed password for the user. In your example, it is represented by an asterisk (*), which indicates that the account is locked or that no password is set.
  • last change: This field indicates the number of days since January 1, 1970, when the password was last changed. In your example, it is 20201, which corresponds to a specific date.
  • min: The minimum number of days required between password changes. A value of 0 means that the user can change their password at any time.
  • max: The maximum number of days the password is valid. After this period, the user will be required to change their password. In your example, it is 99999, which effectively means the password does not expire.
  • warn: The number of days before password expiration during which the user is warned to change their password. In your example, it is 7, meaning the user will be warned 7 days before the password expires.
  • inactive: The number of days after a password expires until the account is permanently disabled. In your example, this field is empty, indicating that there is no inactive period set.
  • expire: The date on which the account will be disabled, represented as the number of days since January 1, 1970. In your example, this field is empty, meaning the account does not have a set expiration date.

/var: system binaries and Logs

Sun-July-linux-18-41.png

Sun-July-linux-18-41_1.png

Sun-July-linux-18-49.png